1 	protected void button_Click(object sender, EventArgs e)
2 	{
3 		if (this.InnerButtonClick != null)
4 		{
5 			Button b = (Button)sender;          //grab the button that caused the event
6 			Show s = buttons[b];                //retrieve the show associated with said buttton
7 			if (booking == null)
8 			{
9 				booking = bookingService.CreateLocalBooking();              //create an empty booking object
10				booking.EmpId = employee.EmployeeId;                        //add the employeeId to the booking object
11				booking.PbList.Add(bookingService.CreateLocalPartBooking());//create and add an empty partbooking object to the booking object
12				int i = booking.PbList.Count - 1;                           //retrieve the newly created partbooking index
13				booking.PbList[i].TheShow = s;                              //add the desired show to the partbooking object    
14			}
15			else
16			{
17				booking.PbList.Add(bookingService.CreateLocalPartBooking());
18				int i = booking.PbList.Count - 1;                           //retrieve the newly created partbooking index
19				booking.PbList[i].TheShow = s; 
20
21				MessageBox.Show("opret partbk efter fortryd: " + booking.PbList.Count.ToString());
22			}
23			this.InnerButtonClick(sender, e);   //væsentligt at denne linie kommer sidst, da intet efterfølgende bliver udført.
24		}
25	}